package com.van.Service.impl;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.van.Service.ArticlesService;
import com.van.entity.Articles;
import com.van.mapper.ArticlesMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author VanKa qq:2395073039
 * @date 2021/6/9 14:46
 */
@Service
public class ArticlesServiceImpl extends ServiceImpl<ArticlesMapper, Articles> implements ArticlesService {

    @Override
    public Articles getOneData(QueryWrapper<Articles> queryWrapper) {
        List<Articles> list = list(queryWrapper);
        if (list.size() == 1){
            return list.get(0);
        }else {
            return null;
        }
    }
}
